#include "stdafx.h"
#include "Customer.h"
#include "Phone.h"
#include "Accessory.h"

int CCustomer::getAge()
{
	int nPosYear = m_sDateBorn.ReverseFind('-');
	CString sYear = m_sDateBorn.Mid(nPosYear+1,4);
	SYSTEMTIME time;
	GetLocalTime( &time );
	int nAge = time.wYear - _tstoi(sYear);
	return nAge;
}

bool CCustomer::goBuy(CBasketProduct* pBasket)
{
	bool bResult = false;
	if (pBasket && !pBasket->isEmpty())
	{
		
	}
	return bResult;
}

bool goWarranty(CProduct* pProduct)
{
	bool bResult = false;
	if (pProduct)
	{
		if (typeid(*pProduct) == typeid(CPhone))
		{
		}
		else if (typeid(*pProduct) == typeid(CAccessory))
		{
		}
	}
	return bResult;
}